package com.codejiwei.flink.cdc;

import com.alibaba.fastjson2.JSONObject;
import com.codejiwei.flink.source.DebeziumSourceRecord;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.List;

/**
 * author: codejiwei
 * date: 2023/8/27
 * desc:
 **/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class DebeziumRecord {
    @JsonProperty(value ="op")
    public String op;

    @JsonProperty(value ="before")
    public JSONObject before;

    @JsonProperty(value ="after")
    public JSONObject after;

    @JsonProperty(value ="source")
    public DebeziumSourceRecord source;

    @JsonProperty(value ="pkNames", required = true)
    public List<String> pkNames;

    @JsonProperty(value ="pkName", required = true)
    public String pkName;

    @JsonProperty(value ="pkValue", required = true)
    public String pkValue;

    @JsonProperty(value ="ts_ms")
    public Long tsMs;

}
